import Layout from '@/layouts/index.vue'
import ListIcon from '@/assets/test-img/icon_menu_shuju.svg'
import FormIcon from '@/assets/test-img/icon_menu_cheliang.svg'
import GrzxIcon from '@/assets/test-img/icon_menu_grzx.svg'
import DetailIcon from '@/assets/test-img/icon_xq.svg'
import DashboardIcon from '@/assets/test-img/icon_menu_zhuye.svg'
import HomeIcon from '@/assets/test-img/icon_menu_diaodu.svg'
import ModelIcon from '@/assets/test-img/icon_menu_zj.svg'

const normalRouter = [
  {
    path: '/list',
    name: 'list',
    component: Layout,
    redirect: '/list/base',
    meta: {
      title: '列表页',
      icon: ListIcon
    },
    children: [
      {
        path: 'base',
        name: 'ListBase',
        component: () => import('@/pages/list/base/index.vue'),
        meta: {
          title: '列表(基础)',
          // 用来修改当出现子菜单在active状态不会激活父元素的active状态
          // singles: true,
          icon: FormIcon
        }
      },
      {
        path: 'tab',
        name: 'ListTab',
        component: () => import('@/pages/list/tab/index.vue'),
        meta: {
          title: '列表(Tab切换列表)',
          icon: ListIcon
        }
      },
      {
        path: 'topTab',
        name: 'ListTabTop',
        component: () => import('@/pages/list/topTab/index.vue'),
        meta: {
          title: '列表(Tab切换页面)',
          icon: GrzxIcon
        }
      },
      {
        path: 'statistics',
        name: 'statistics',
        component: () => import('@/pages/list/statistics/index.vue'),
        meta: {
          title: '列表(关键数据)',
          icon: DetailIcon
        }
      },
      {
        path: 'card',
        name: 'ListCard',
        component: () => import('@/pages/list/card/index.vue'),
        meta: {
          title: '列表(卡片式)',
          icon: DashboardIcon
        }
      },
      {
        path: 'tree',
        name: 'ListTree',
        component: () => import('@/pages/list/tree/index.vue'),
        meta: {
          title: '列表(树状筛选)',
          icon: HomeIcon
        }
      },
      {
        path: 'noData',
        name: 'noData',
        component: () => import('@/pages/list/noData/index.vue'),
        meta: {
          title: '列表(无数据)',
          single: true,
          icon: ModelIcon
        }
      },
      {
        path: 'thirdRoutesA',
        name: 'thirdRoutesA',
        parent: 'noData',
        component: () =>
          import('@/pages/list/noData/components/thirdRoutesA.vue'),
        meta: {
          title: '三级路由页面A'
        }
      },
      {
        path: 'thirdRoutesB',
        name: 'thirdRoutesB',
        // parent的值最后会添加到对应菜单下的子菜单
        parent: 'noData',
        component: () =>
          import('@/pages/list/noData/components/thirdRoutesB.vue'),
        meta: {
          title: '三级路由页面B'
        }
      }
    ]
  },
  {
    path: '/form',
    name: 'form',
    component: Layout,
    redirect: '/form/step',
    meta: {
      title: '表单页',
      icon: FormIcon
      // 点击后直接进入路由和对应页面不展开子菜单
      // single: true
    },
    children: [
      {
        path: 'step',
        name: 'FormStep',
        component: () => import('@/pages/form/step/index.vue'),
        meta: {
          title: '分步表单页',
          icon: FormIcon
        }
      },
      {
        path: 'thirdRoutesC',
        name: 'thirdRoutesC',
        parent: 'FormStep',
        component: () =>
          import('@/pages/list/noData/components/thirdRoutesA.vue'),
        meta: {
          title: '三级路由页面A'
        }
      },
      {
        path: 'thirdRoutesD',
        name: 'thirdRoutesD',
        // parent的值最后会添加到对应菜单下的子菜单
        parent: 'FormStep',
        component: () =>
          import('@/pages/list/noData/components/thirdRoutesB.vue'),
        meta: {
          title: '三级路由页面B'
        }
      }
    ]
  },

  {
    path: '/detail',
    name: 'detail',
    component: Layout,
    redirect: '/detail/base',
    meta: {
      title: '详情页',
      icon: DetailIcon
    },
    children: [
      {
        path: 'base',
        name: 'DetailBase',
        component: () => import('@/pages/detail/base/index.vue'),
        meta: {
          title: '基础详情页',
          icon: GrzxIcon
        }
      },
      {
        path: 'advanced',
        name: 'DetailAdvanced',
        component: () => import('@/pages/detail/advanced/index.vue'),
        meta: {
          title: '多卡片详情页',
          icon: DetailIcon
        }
      },
      {
        path: 'deploy',
        name: 'DetailDeploy',
        component: () => import('@/pages/detail/deploy/index.vue'),
        meta: {
          title: '数据详情页',
          icon: DashboardIcon
        }
      },
      {
        path: 'secondary',
        name: 'DetailSecondary',
        component: () => import('@/pages/detail/secondary/index.vue'),
        meta: {
          title: '二级详情页',
          icon: HomeIcon
        }
      }
    ]
  },
  {
    path: '/user',
    name: 'user',
    component: Layout,
    redirect: '/user/index',
    meta: { title: '个人页', icon: GrzxIcon, single: true },
    children: [
      {
        path: 'index',
        name: 'UserIndex',
        component: () => import('@/pages/user/index.vue'),
        meta: { title: '个人中心', icon: GrzxIcon }
      }
    ]
  }
]

export default normalRouter
